from page_object.login_page import Login
import unittest
from selenium import webdriver

""" 测试用例 """

class HuaXiHuiYanCace(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = webdriver.Chrome()
        cls.driver.get("http://javaweb.aroundme.tv:8083/Testhuaxi/login.jsp")

    """ 登录 """
    def testLogin(cls):
        login = Login(cls.driver)
        cls.title, cls.text = login.login()
        cls.assertEqual(cls.title, "花溪慧眼后台管理系统", msg="登录失败")
        cls.assertEqual(cls.text, "lixuechun", msg="登录用户名显示错误")

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

if __name__ == "__main__":
    unittest.main()





